package view.HelperClasses;

import java.awt.BorderLayout;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.net.URL;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class BackgroundPanel extends JPanel 
{
	private JFrame background;
	private URL locatie;
	
	public BackgroundPanel(JFrame frame, URL locatie) {
            background = frame;
            this.locatie = locatie;
            this.setLayout(new BorderLayout());
	}
        
	public void paintComponent(Graphics g) {
            super.paintComponent(g);
            Image backgroundImage = Toolkit.getDefaultToolkit().getImage(locatie);
            g.drawImage(backgroundImage, 0, 0, background.getWidth(), background.getHeight(), background);
	}
        
}
